function [ subject, channel, channelType, condition, frequencies, times, nrOfEpochs ] = GetTimeFrequencyRowByFilename( filename )
%GETTIMEFREQUENCYROWBYFILENAME Gets all metadata for filename from the database

global Database;

cFilename = strcmp(Database.timefrequency_header, 'Filename');
cSubject = strcmp(Database.timefrequency_header, 'Subject');
cChannel = strcmp(Database.timefrequency_header, 'Channel');
cChannelType = strcmp(Database.timefrequency_header, 'ChannelType');
cCondition = strcmp(Database.timefrequency_header, 'Condition');
cFrequencies = strcmp(Database.timefrequency_header, 'Frequencies');
cTimes = strcmp(Database.timefrequency_header, 'Times');
cNrOfEpochs = strcmp(Database.timefrequency_header, 'NrOfEpochs');

rFilename = strcmp(Database.timefrequency(:, cFilename), filename);
if ~any(rFilename)
    error('File doesn''t exist in database')
end

subject = Database.timefrequency{rFilename, cSubject};
channel = Database.timefrequency{rFilename, cChannel};
channelType = Database.timefrequency{rFilename, cChannelType};
condition = Database.timefrequency{rFilename, cCondition};
frequencies = Database.timefrequency{rFilename, cFrequencies};
times = Database.timefrequency{rFilename, cTimes};
nrOfEpochs = Database.timefrequency{rFilename, cNrOfEpochs};

end

